package com.ty.day4;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 * Author : txy
 * Create 2023/10/31 10:22
 */
public class Four {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个不超过5位的正整数(0退出)：");
        int x = sc.nextInt(), s = 0, a = x;
        while (x / 10000 >= 10 || x < 0) {

            System.out.print("请输入一个不超过5位的正整数(0退出)：");
            if (x == 0) {
                break;
            }
            x = sc.nextInt();
        }
        int t = x;
        while (x > 0) {
            System.out.print(x % 10 + " ");
            s++;
            x /= 10;
        }
        if (a != 0) {
            System.out.println("\n" + t + "是" + s + "位数");
        }

    }
}
